using System;
using System.Collections.Generic;
using UnityEngine;

namespace NodeCanvas.StateMachines
{
	[AddComponentMenu("NodeCanvas/FSM Owner")]
	public class FSMOwner : GraphOwner
	{
		public FSM FSM;

		public override Graph behaviour
		{
			get
			{
				return FSM;
			}
			set
			{
				FSM = (FSM)value;
			}
		}

		public override Type graphType
		{
			get
			{
				return typeof(FSM);
			}
		}

		public string currentStateName
		{
			get
			{
				return (!(FSM != null)) ? null : FSM.currentStateName;
			}
		}

		public string lastStateName
		{
			get
			{
				return (!(FSM != null)) ? null : FSM.lastStateName;
			}
		}

		public FSMState TriggerState(string stateName)
		{
			if (FSM != null)
			{
				return FSM.TriggerState(stateName);
			}
			return null;
		}

		public List<string> GetStateNames()
		{
			if (FSM != null)
			{
				return FSM.GetStateNames();
			}
			return null;
		}
	}
}
